#include<vector>
using namespace std;
class Solution {
public:
    vector<vector<int>> generate(int numRows) {
        vector<vector<int>> rows;
        rows.resize(numRows,vector<int>());
        for(int i=0;i<rows.size();++i)//初始化
        {
            rows[i].resize(i+1,0);
            rows[i][0]=1;
            rows[i][i]=1;
        }

        for(int i=0;i<rows.size();++i)
        {
            for(int j=0;j<rows[i].size();++j)
            {
                if(rows[i][j]==0)
                {
                    rows[i][j]=rows[i-1][j-1]+rows[i-1][j];
                }
            }
        }
        return rows;
    }
};